package com.google.gwt.livinglife.client.widgets;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.livinglife.client.LivingLife;
import com.google.gwt.livinglife.client.data.LivingLifeGroupData;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;

public class GroupDataWidget extends VerticalPanel {
	private LivingLifeGroupData group_data;
	private Anchor group_name = new Anchor();
	private Label description = new Label();
	
	public GroupDataWidget() {
		add(group_name);
		group_name.setHorizontalAlignment(ALIGN_CENTER);
		add(description);
	}
	
	public void SetGroupData(LivingLifeGroupData data) {
		group_data = data;
		group_name.setHTML("<h3> " + group_data.getName() + "</h3>");
		group_name.setHref(LivingLife.getGroupIdUrl(group_data.getId()));
		description.setText(group_data.getDescription());
	}
}
